package com.zadtek.shopmall.activities;

import android.support.v4.app.Fragment;

import com.zadtek.shopmall.base.AbsViewPagerActivity;
import com.zadtek.shopmall.fragments.AllOrderFragment;

import java.util.LinkedList;
import java.util.List;

import static com.zadtek.shopmall.activities.RedEnvelopActivity.TAB_1;
import static com.zadtek.shopmall.activities.RedEnvelopActivity.TAB_2;
import static com.zadtek.shopmall.activities.RedEnvelopActivity.TAB_3;


public class OrderDetailActivity extends AbsViewPagerActivity {

    @Override
    public String getTopTitle() {
        return "我的订单";
    }

    @Override
    protected List<Fragment> getFragments() {
        List<Fragment> fragments = new LinkedList<>();
        fragments.add(AllOrderFragment.Instance(TAB_1));
        fragments.add(AllOrderFragment.Instance(TAB_2));
        fragments.add(AllOrderFragment.Instance(TAB_3));
        return fragments;
    }

    @Override
    protected List<String> getTabTitles() {
        List<String> titles = new LinkedList<>();
        titles.add("全部订单");
        titles.add("待付款");
        titles.add("待收货");
        return titles;
    }

    @Override
    public void initLogic() {
        int index = getIntent().getIntExtra("index",0);
        viewPager.setCurrentItem(index);
    }
}
